﻿using SqlSugar;
using System.ComponentModel.DataAnnotations;

namespace MES.Core.Model
{
    [SugarTable("GenerateModeEntity")]
    public class GenerateModeEntity
    {
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnDescription = "主键")]//如果是主键，此处必须指定，否则会引发InSingle(id)方法异常。     
        public int Id { get; set; }
        /// <summary>
        /// 表名称(实体名称)
        /// </summary>
        [Required(ErrorMessage = "表名称必填")]
        public string TableName { get; set; }

        /// <summary>
        /// 表注释
        /// </summary>
        [Required(ErrorMessage = "表注释必填")]
        public string TableNameComment { get; set; }

        /// <summary>
        /// 文件绝对路径
        /// </summary>
        [Required(ErrorMessage = "文件绝对路径必填")]
        public string FilePath { get; set; }

        /// <summary>
        /// 命名空间
        /// </summary>
        [Required(ErrorMessage = "命名空间必填")]
        public string Namespace { get; set; }
    }

    public class GenerateKey
    {
        /// <summary>
        /// 字段名称
        /// </summary>
        [Required(ErrorMessage = "字段名称必填")]
        public string KeyName { get; set; }

        /// <summary>
        /// 字段类型
        /// </summary>
        [Required(ErrorMessage = "字段类型必填")]
        public string KeyType { get; set; }

        /// <summary>
        /// 字段长度
        /// </summary>
        [Required(ErrorMessage = "字段长度必填")]
        public int KeyLength { get; set; }

        /// <summary>
        /// 字段注释
        /// </summary>
        [Required(ErrorMessage = "字段注释必填")]
        public string KeyComment { get; set; }

    }
}
